package demo1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Ioc控制反转
 */
public class Demo {
    public static void main(String[] args) {

        //Spring容器提供的核心类
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext("demo1");
        User user2 = context.getBean(User.class);
        user2.sayHello();

    }
}
